import React from 'react';
import { withRouter } from 'react-router-dom'
import './style.scss';
class Prolist extends React.Component {
  render () {
    let prolist = this.props.prolist
    return (
      <ul className="prolist">
        {
          prolist.map((item) => {
            return (
              <li onClick = {
                () => {
                  console.log(this.props)
                  this.props.history.push('/other/detail/' + item.proid)
                }
              } className="item" key={ item.proid }>
                <div className="itemimg">
                  <img src={item.proimg} alt=""/>
                </div>
                <div className="iteminfo">
                  <h3>{ item.proname }</h3>
                </div>
              </li>
            )
          })
        }
      </ul>
    )
  }
}

export default withRouter(Prolist)